cmake_minimum_required(VERSION 3.10)
project(libvision)

SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_BUILD_TYPE Release)

SET(LIBVISION_INCLUDE_DIRS "./include")

SET(OpenCV_INCLUDE_DIRS "3rdparty/opencv/include")
SET(OpenCV_LIBS_DIR "3rdparty/opencv/bin")

SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/opencv/bin/")
MESSAGE(${CMAKE_INSTALL_RPATH})

# FIND_PACKAGE(OpenCV 4 REQUIRED)

FILE(GLOB SOURCE_FILES "src/*.cpp")
FILE(GLOB HEADER_FILES "include/*.h")

LINK_DIRECTORIES(${PROJECT_NAME} ${OpenCV_LIBS_DIR})
ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})

TARGET_INCLUDE_DIRECTORIES(
        ${PROJECT_NAME} PRIVATE
        ${LIBVISION_INCLUDE_DIRS}
        ${OpenCV_INCLUDE_DIRS}        
)

TARGET_LINK_LIBRARIES(
        ${PROJECT_NAME}
        opencv_world440
)
